import { BrowserRouter, Routes, Route } from "react-router-dom";
import Login from "@/views/Login";
import App from "@/App";
import Home from "@/views/Home";
import Fast from "@/views/Fast";
import Mine from "@/views/Mine";
import Select from "@/views/Select";
import Practice from "@/views/Practice";
import Subjects from "@/views/Subjects";

const router = (
  <BrowserRouter>
    <Routes>
      {/* 登录+注册 */}
      <Route path="/login" element={<Login />}></Route>
      {/* 父级路由组件 */}
      <Route path="/" element={<App />}>
        {/* 首页 */}
        <Route path="home" element={<Home />}></Route>
        {/* 快速刷题 */}
        <Route path="fast" element={<Fast />}></Route>
        {/* 我的 */}
        <Route path="mine" element={<Mine />}></Route>
        {/* 选择题目页面 */}
        <Route path="select/:actionCode" element={<Select />}></Route>
        {/* 做题页面 */}
        <Route path="practice" element={<Practice />}></Route>
        {/* 切换学科 */}
        <Route path="subjects" element={<Subjects />}></Route>
      </Route>
    </Routes>
  </BrowserRouter>
);
export default router;
